<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>P217 9.4.2 String类中的方法</title>
</head>

<body>
    <script>
        var str = '123*abc.456';
        console.log(str.search('.*'));
        console.log(str.search(/[\.\*]/));
        var str1 = 'test@123.com';
        var reg = /[@\.]/;
        var split_res = str.split(reg);
        console.log(split_res);
        var str2 = 'We are a family';
        var reg1 = /\s/;
        var split_res1 = str.split(reg1, 2);
        console.log(split_res1);
    </script>>
    <a href="../首页/page09.html">
        <h2>返回上一页面</h2>
    </a>
</body>

</html>